import request from '@/utils/request'

const role_link = "/admin/system/role";

export function index(page, limit, search) {
  return request({
    url: `${role_link}/${page}/${limit}`,
    method: 'post',
    data: search
  })
}

export function insertRole(data) {
  return request({
    url: `${role_link}/insertRole`,
    method: 'post',
    data: data
  })
}

export function updateRole(data) {
  return request({
    url: `${role_link}/updateRole`,
    method: 'post',
    data: data
  })
}

export function deleteRole(data) {
  return request({
    url: `${role_link}/deleteRole`,
    method: 'post',
    data: data
  })
}

export function getRoleMenu(data) {
  return request({
    url: `${role_link}/getRoleMenu`,
    method: 'post',
    data: data
  })
}

export function menuGrant(roleId,data) {
  return request({
    url: `${role_link}/menuGrant/${roleId}`,
    method: 'post',
    data: data
  })
}